﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace EmailFinder
{
    class EmailFinder
    {
        static void Main(string[] args)
        {
            string text = "zuzi@mail.bg;; ciki@duduk.net, asdasdhasdasdjajgfajg asjg saj aj asjd j" +
                "bob@mail.bg\nasdasdasdkdkask@asdasdasdasd\nfn12345@fmi.uni-sofia.bg ffaskdkk\n" +
                "    mente@eu.int | , , ;;; gero@dir.bg";

            string pattern = @"(\w|_|\.)+@(\w|-|\.|_)+\.[\w]{1,3}";

            Regex regex = new Regex(pattern);
            Match match = regex.Match(text);

            while (match.Success)
            {
                Console.WriteLine(match.Value);
                match = match.NextMatch();
            }
        }
    }
}
